<?php

class Application_Model_DbTable_DadosBanco extends Zend_Db_Table_Abstract
{

    protected $_name = 'dadosbanco';
    protected $_referenceMap = array
    (
       array(
            'refTableClass' => 'Application_Model_DbTable_Banco',
            'refColumns' => 'id',
            'columns' => array('banco_id')
        )
    );

    public function getDadosBanco($banco_id)
    {
        $select = $this->select();
        $select->from($this, array('count(*) as amount'))->where('banco_id ='.$banco_id);
        $rows = $this->fetchAll($select);

        return($rows[0]->amount);
    }
       
}

